<%--
  Created by IntelliJ IDEA.
  User: cyc
  Date: 2021/10/2
  Time: 15:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>后台管理 - 易买网</title>
    <link type="text/css" rel="stylesheet" href="../css/style.css" />
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/jquery-1.8.3.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/scripts/function.js"></script>
</head>
<body>

    <div class="main">
        <h2>订单管理</h2>
        <div class="manage">
            <div class="layui-form-item">
                <label class="layui-form-label">支付订单号</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="serialNumber">
                </div>

                <label class="layui-form-label">登陆账号</label>
                <div class="layui-input-inline">
                    <input type="text" class="layui-input" name="userName">
                </div>

                <button class="layui-btn" id="searchbtn">搜索订单</button>

            </div>
            <table  id="usertable" lay-filter="usertable">


            </table>
        </div>
    </div>
    <div class="clear"></div>

</div>
<div id="footer">
    Copyright &copy; 2013 北大青鸟 All Rights Reserved. 京ICP证1000001号
</div>



<script src="${pageContext.request.contextPath}/layui/layui.js"></script>
<script>
    var $=layui.$;



    layui.use(["table",'layer'],function (){
        var table=layui.table;
        var layer=layui.layer;
        table.render({
            elem: '#usertable'
            ,height: 500
            ,url: '${pageContext.request.contextPath}/orderdetail/all' //数据接口
            ,page: true //开启分页
            ,cols: [[ //表头
                {field: 'serialnumber', title: '支付订单号', width:300, fixed: 'left'}
                ,{field: 'name', title: '商品名称', width:150}
                ,{field: 'quantity', title: '数量', width:80}
                ,{field: 'cost', title: '消费', width: 177}
                ,{field: 'loginname', title: '登陆账号', width: 200}
                ,{field: 'createtime', title: '时间', width: 200}
            ]]
        });

        $("#searchbtn").click(function (){

            var  serialNumber=$("input[name=serialNumber]").val();


            var userName=$("input[name=userName]").val();

            table.reload('usertable', {
                where: {
                    'serialnumber':serialNumber
                    ,'loginname': userName
                    //…
                }
                ,page: {
                    curr: 1 //重新从第 1 页开始
                }
            }); //只重载数据
        });

    });
</script>
</body>
</html>
